#ifndef WIDGET_PATIENT_H
#define WIDGET_PATIENT_H

#include <QWidget>
#include <QPainter>
#include <QMouseEvent>
#include "./Common/config.h"
#include "./Common/usermanagement.h"
#include "./Common/othertablemanagement.h"

namespace Ui {
class Widget_patient;
}

class DoctorManagement;
class PatientManagement;
class AppointmentManagement;
class AdviceManagement;
class PrescriptionManagement;
class MedicalRecordManagement;

class Widget_patient : public QWidget
{
    Q_OBJECT

public:
    explicit Widget_patient(QWidget *parent = nullptr, QString userId = "", DoctorManagement* dm = nullptr,
                            PatientManagement* pm = nullptr, AppointmentManagement* am = nullptr,
                            AdviceManagement* adm = nullptr, PrescriptionManagement* pscm = nullptr,
                            MedicalRecordManagement* mrm = nullptr);
    void initUserInfo();
    ~Widget_patient();

    void updateDoctors(const QString &department);
    void showHealthAssessmentClient();
    void showChatClient();
signals:
    void requestShowHealthAssessmentClient();
    void requestChatClient();

private slots:
    void on_pushButton_exit_clicked();

    void on_update_btn_clicked();

    void on_profes_cbox_currentIndexChanged(const QString &arg1);

    void on_submit_appoint_btn_clicked();

    void on_getDocInfo_btn_clicked();

    void on_getInstruction_btn_clicked();

    void on_getMedicalRecord_btn_clicked();

    void on_getPrescription_btn_clicked();

    void on_chat_btn_clicked();

    void on_health_assessment_btn_clicked();

    void on_getPatientInfo_btn_clicked();

    void on_appointment_btn_clicked();

protected:
    virtual void paintEvent(QPaintEvent *event);
    virtual void resizeEvent(QResizeEvent *event);
    void connectToPatient();

private:
    Ui::Widget_patient *ui;
    QPoint mousePos;
    std::shared_ptr<DoctorManagement> d_m;
    std::shared_ptr<PatientManagement> p_m;
    std::shared_ptr<AppointmentManagement> a_m;
    std::shared_ptr<AdviceManagement> ad_m;
    std::shared_ptr<PrescriptionManagement> psc_m;
    std::shared_ptr<MedicalRecordManagement> mr_m;
    QString user_id;
    // ------------------------------------
};



#endif // WIDGET_PATIENT_H
